package com.lcf.demo;

public class Worker {
// 1。   定义属性
//    1.a 定义姓名
    private String name;
//    1.b 定义工龄
    private double year;
//定义无参构造
    public Worker() {
    }
//定义有参构造
    public Worker(String name, double year) {
        this.name = name;
        this.year = year;
    }
//定义setter和getter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getYear() {
        return year;
    }

    public void setYear(double year) {
        this.year = year;
    }
//    定义行为




}

